<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.cnbj1.fds.api.mi-img.com/mi.com-assets/shop/pro/css/buy/cart2.382798e6.css">
    <script src="../js/vue.js"></script>
    <style>
        *{padding: 0;margin: 0;}
        .checkbox{
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 1px;
            overflow: hidden;
            border: 1px solid #e0e0e0;
            margin: 5px;
            user-select: none;
        }
        .checkbox i{
            display: block;
            width: 20px;
            height: 20px;
            /* 没有切换之前的状态 */
            background-color: #fff;
            color: #fff;
            text-align: center;
            line-height: 20px;
        }

        .checkbox i:hover{
            color: #333;
        }

        /* 变为选中之后的状态 */
        .checkbox input[type='checkbox']:checked + i.iconfont {
            background-color: #ff6700;
            color: #fff;
        }
    </style>
</head>
<body>
    <div id="app">
        <label class="checkbox">
            <input type="checkbox" hidden name="" id="">
            <i class="iconfont">√</i>
        </label>
    </div>
</body>
</html>